package JavaBase.Polymorphism;

public class Div extends Calculator{
    public Div(double number1,double number2)
    {
        super(number1,number2);
    }
    public void count()
    {
         if(this.getNumber2()==0)
         {
             System.out.println("除数不能为0.");
             System.exit(1);
         }
        System.out.println(this.getNumber1()+"/"+this.getNumber2()+"="
                +(this.getNumber1()/this.getNumber2()));
    }
}
